package com.xcf.service.business.wharfmanage.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.google.common.collect.Maps;
import com.xcf.dao.DaoSupport;
import com.xcf.entity.business.common.FACTSEAL;
import com.xcf.service.business.wharfmanage.NumberEntryService;
import com.xcf.util.PageData;
@Service("NumberEntryServiceImpl")
public class NumberEntryServiceImpl  implements NumberEntryService{
	@Resource(name="daoSupport")
	private DaoSupport daoSupport;

	//查询船名
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> searship(PageData pd) throws Exception {
		
		return (List<PageData>) daoSupport.findForList("numberentrymapper.searship", pd);
	}

	//查询航次
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> searvoyage(PageData pd) throws Exception {
		
		return (List<PageData>) daoSupport.findForList("numberentrymapper.searvoyage", pd);
	}

	//查询托单表
	@SuppressWarnings("unchecked")
	@Override
	public List<Map> sear(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) daoSupport.findForList("numberentrymapper.sear", pd);
	}

	//查询封箱号
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> searfeng(PageData pd) throws Exception {
		
		return (List<PageData>) daoSupport.findForList("numberentrymapper.searfeng", pd);
	}

	//修改状态
	@Override
	public void upd(PageData pd) throws Exception {
	daoSupport.update("numberentrymapper.upd", pd);
	}

	
	@Override
	public void edit(PageData pd) throws Exception {
		daoSupport.update("numberentrymapper.edit", pd);
		
	}

	//导出到excel
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> queryByBillCode(Map param) throws Exception {
		
		return (List<PageData>) daoSupport.findForList("numberentrymapper.queryByBillCode", param);
	}

	//点击保存判断封箱号里面有无数据
	@Override
	public PageData seraxiang(PageData pd) throws Exception {
		
		return (PageData) daoSupport.findForObject("numberentrymapper.seraxiang", pd);
	}

	//查询脱单表
	@Override
	public PageData seartuo(PageData pd) throws Exception {
		
		return (PageData) daoSupport.findForObject("numberentrymapper.seartuo", pd);
	}

	//新增封箱号
	@Override
	public void add(PageData ob) throws Exception {
		daoSupport.save("numberentrymapper.add", ob);
		
	}

	@Override
	public void Upde(PageData ob) throws Exception {
		daoSupport.update("numberentrymapper.Upde", ob);
		
	}

	//修改封箱号
	@Override
	public void Edit(PageData ob) throws Exception {
		daoSupport.update("numberentrymapper.Edit", ob);
		
	}

	//查询
	//@Override
	@SuppressWarnings("unchecked")
	public List<PageData> cha(PageData pd) throws Exception {
		
		return (List<PageData>) daoSupport.findForList("numberentrymapper.cha", pd);
	}

	//修改
	public boolean updateInfo(PageData pd) throws Exception {
		
		int a= (int) daoSupport.update("numberentrymapper.updateInfo", pd);
				if(a>0){
		return true;
				}
				return false;
	}

	@Override
	public boolean add1(PageData pd) throws Exception {
	int a=	(int) daoSupport.save("numberentrymapper.add1", pd);
	if(a>0){
		return true;
	}
		return false;
		
		
	}

	@Override
	public boolean add2(PageData pd) throws Exception {
		int a=	(int) daoSupport.save("numberentrymapper.add2", pd);
		if(a>0){
			return true;
		}
			return false;
			
			
	
	}

	@Override
	public boolean updateInfo2(PageData pd) throws Exception {
		int a= (int) daoSupport.update("numberentrymapper.updateInfo2", pd);
		if(a>0){
    return true;
		}
		return false;
}

	@Override
	public List<PageData> fengxiang(PageData pd) throws Exception {
		
		return (List<PageData>) daoSupport.findForList("numberentrymapper.fengxiang", pd);
	}

	//修改封箱表 根据提单编号
	@Override
	public boolean updateInfo3(PageData pd) throws Exception {
		
		int a= (int) daoSupport.update("numberentrymapper.updateInfo3", pd);
		if(a>0){
		    return true;
				}
				return false;
	}


	

}
